package com.xuhuan.admin.controller.home;

import com.xuhuan.admin.service.home.HomeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @author: huan.xu
 * @create: 2024/7/8 18:05
 * @description: 主页控制器
 **/
@RequestMapping("/home")
@Controller
public class HomeController {

  @Autowired
  private HomeService homeService;

  /**
   * 首页
   *
   * @return
   */
  @GetMapping("/index")
  public String index(Model model) {
    homeService.handleData(model);
    return "index";
  }

  /**
   * 案例主页
   *
   * @return
   */
  @GetMapping("/demo-main")
  public String demoMain(Model model) {
    return "home/demoMain";
  }


}
